Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Radiology report exports #203

Merged
merged 46 commits into from
Jan 12, 2024
Merged

Radiology report exports #203

merged 46 commits into from
Jan 12, 2024

Conversation

jeremyestein
Copy link
Contributor

@jeremyestein jeremyestein commented Jan 3, 2024

Define an API call in pixl ehr that triggers:

  • extract all EHR records from the PIXL DB that match the specified extract (as defined by project name and extract datetime)
  • dump to a single parquet file in the mounted export dir

For a later PR:

  • Adding a command to the CLI to call this API
  • Add to system test (depends on CLI call) - (add cli call after pixl populate, but how to wait until done processing)

Fixes #161

Enable deferred annotations everywhere and fix annotations and comments (#206)

* Defer annotations in all files and fix some pre-existing comment quirks

* Applied ruff fixes with and without `--unsafe-fixes` flag

* Some manual fixes
actual change]

Merge branch 'main' into jeremy/issue-161-radiology
pixl_core/src/core/omop.py Outdated Show resolved Hide resolved
pixl_core/src/core/omop.py Outdated Show resolved Hide resolved
pixl_core/src/core/omop.py Outdated Show resolved Hide resolved
pixl_core/src/core/omop.py Outdated Show resolved Hide resolved
milanmlft and others added 7 commits January 9, 2024 19:10
Allows exporting radiology reports for specific project only
extract to parquet.
Need different accession numbers in test messages to avoid them getting
de-duped.
Test code was only fetching first row of query so above problem was
harder to detect.
@jeremyestein jeremyestein marked this pull request as ready for review January 11, 2024 12:02
Copy link
Contributor

@stefpiatek stefpiatek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good, only blocking change is adding in a new endpoint to the hashing API, worth discussing that and then some other thoughts

Comment on lines 62 to 68
@router.get(
"/hash-image-identifier",
summary="Produce secure hash appropriate for an image identifier "
"(MRN + accession num concatenated)",
)
async def hash_image_identifier(message: str) -> Response:
return Response(content=generate_hash(message, 64), media_type="application/text")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh this surprises me. Why are we making a seperate endpoint that has the same implementation as hash?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mainly I was following the existing pattern. But do the different types of input even need different hashing methods? I'm not sure what the requirements are here.

Copy link
Contributor

@stefpiatek stefpiatek Jan 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I think the previous is a bit silly too. I'd remove and just use /hash. I assume it was planned to do something like restricting the size of it like they did with accession number, but then that changed and they didn't remove the superflous extra endpoint

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have removed the new endpoint. Shall we save the consolidation of the other endpoints for another PR?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe make a new issue so we don't forget / to discuss further?

pixl_core/src/core/omop.py Outdated Show resolved Hide resolved
pixl_core/src/core/omop.py Outdated Show resolved Hide resolved
pixl_core/src/core/omop.py Outdated Show resolved Hide resolved
pixl_ehr/pyproject.toml Show resolved Hide resolved
pixl_ehr/src/pixl_ehr/main.py Outdated Show resolved Hide resolved
pixl_ehr/tests/test_processing.py Outdated Show resolved Hide resolved
pixl_ehr/tests/test_processing.py Outdated Show resolved Hide resolved
postgres/pixl-db_init.sh Show resolved Hide resolved
Copy link
Contributor

@stefpiatek stefpiatek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, couple of smaller changes but happy to merge once you've resolved them

cli/tests/conftest.py Outdated Show resolved Hide resolved
pixl_ehr/src/pixl_ehr/_processing.py Outdated Show resolved Hide resolved
@jeremyestein jeremyestein merged commit b51943f into main Jan 12, 2024
8 checks passed
@jeremyestein jeremyestein deleted the jeremy/issue-161-radiology branch January 12, 2024 10:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Export radiology reports as parquet file
3 participants